﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BEGDC.Utility.Configuration;
using BEGDC.Utility.Security;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ASBCC.Test
{
    /// <summary>
    /// Summary description for DataEntityTest
    /// </summary>
    [TestClass]
    public class DataEntityTest
    {
        public DataEntityTest()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void EncrptData()
        {
            //string source = "Data Source=135.251.34.230;DataBase=CustomerCare4;user id=ezvisit;password=asb#2345;";
            string source = "Data Source=vs22ccs2;DataBase=CustomerCare3;user id=ezvisit;password=asb#2345;";

            //Data Source=vs22ccs2;DataBase=CustomerCare2;user id=ezvisit;password=asb#2345; : +13GthpZ74a2cGIyHXO8xPYWwaB8XDd2bpk+FqvMzf5EALDemVULj6TV8dizhClR6I0Xokn4+l7ly8DP0K1tpl8+/2rIVu0VSmTmtwMMD2A=
            var s = EncryptTool.Encrypt(source, ConfigConst.Key);
            TestContext.WriteLine(s);
        }

        [TestMethod]
        public void DecrptData()
        {
            //CustomerCareUAT
            //+13GthpZ74buTtQRAQL+SdLhQAqsjSf87MyTtyoMNYEvFJ9aZF+L6HRhaLuHboFOUKcsLYvlKRLLjKsp8DxA/uQcBKpsDvCBVyoF1puDUmDX8Zz2MCzAew==

            //CustomerCare
            //string source = "+13GthpZ74buTtQRAQL+SdLhQAqsjSf87MyTtyoMNYEvFJ9aZF+L6HRhaLuHboFOw6Ttwi5/xuOdjXOdKGgAm/1mC0cxAgnb/G1ErmVLiYlSVuyNKSOwxA==";

            //CustomerCare3
            string source = "+13GthpZ74buTtQRAQL+SdLhQAqsjSf87MyTtyoMNYEvFJ9aZF+L6HRhaLuHboFOpKAdT1q2WCFjJatUq/4AGs44TQv3EPF508NFWYkGlLtEa8sq1tR1LQ==";
            var s = EncryptTool.Decrypt(source, ConfigConst.Key);
            TestContext.WriteLine(s);
        }
    }
}
